package org.mysterylab.utopiaframework.commons.security.springsecurity3;

import java.util.ArrayList;
import java.util.Collection;

import org.mysterylab.utopiaframework.commons.security.springsecurity3.dao.GenericUserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * 实现 Spring Security 的 {@link UserDetailsService} 接口, 实现获取用户详细信息的回调函数.
 * 
 * @author zhouych
 */
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
	
	/**
	 * 操纵用户的 Dao
	 */
	@Autowired
	private GenericUserDao genericUserDao;

	@Override
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException, DataAccessException {
		
		Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
		return null;
	}

}